package com.navinfo.opentsp.platform.computing.analysis.entity;

import com.google.protobuf.ByteString;
import com.navinfo.opentsp.platform.computing.analysis.util.TimeUtil;
import com.navinfo.opentsp.platform.location.protocol.common.LCDrivingBehaviorAnalysis;
import com.navinfo.opentsp.platform.location.protocol.common.LCLocationData;
import com.navinfo.opentsp.platform.location.protocol.common.LCVehicleBreakdown;
import com.navinfo.opentsp.platform.location.protocol.common.LCVehicleStatusData;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * pb协议实体类
 * <p>
 * <p>
 * Created on 16/6/15 13:40
 *
 * @author machi
 */
public class LocationData {
    /**
     * 终端id
     */
    private Long terminalId;
    /**
     * 报警标志
     */
    private long alarm;
    /**
     * 状标志位:786435
     */
    private long status;
    /**
     * 经度:117241438
     */
    private int longitude;
    /**
     * 纬度:31745257
     */
    private int latitude;
    /**
     * 经度（原始数据，未做加密偏移）
     */
    private int originalLng;
    /**
     * 维度（原始数据，未做加密偏移）
     */
    private int originalLat;
    /**
     * 高程，海拔高度，单位为米
     */
    private int height;
    /**
     * 速度(km/h) :0
     */
    private short speed;
    /**
     * 方向(0~359)正北，顺时针 :206
     */
    private short direction;
    /**
     * GPS时间 :1465179562
     */
    private long gpsDate;
    /**
     * 里程，单位米(m) :28560588800
     */
    private long mileage;
    /**
     * 接收时间
     */
    private long receiveDate;
    /**
     * 是否补偿数据：true是；false不是
     */
    private boolean isPatch;
    /**
     * 油量(1/10L) :0
     */
    private int oil;
    /**
     * 行驶记录仪速度(km/h) :0
     */
    private int recorderSpeed;
    /**
     * 超速报警附加信息
     */
    private List<SpeedAddition> speedAddition = new ArrayList<SpeedAddition>();
    /**
     * 进入区域路线报警附加信息
     */
    private List<AreaAddition> areaAddition = new ArrayList<AreaAddition>();
    /**
     * 路段行驶时间不足/过长信息类:
     */
    private List<RouteAddition> routeAddition = new ArrayList<RouteAddition>();
    /**
     * 温度报警附加信息
     */
    private List<TemAddition> temAlarm = new ArrayList<TemAddition>();
    /**
     * 星况（1正常，0不正常，默认为1）
     */
    private int starStatus;
    /**
     * 星数（默认为1）
     */
    private int starNumber;
    /**
     * 需要人工确认的报警ID
     */
    private List<Integer> alarmIdentify = new ArrayList<Integer>();
    /**
     * 车辆信号状态，定义见下文 :0
     */
    private int signalStatus;
    /**
     * IO状态位 :0
     */
    private int ioStatus;
    /**
     * AD0模拟量 :0
     */
    private int analogAD0;
    /**
     * AD1模拟量 :0
     */
    private int analogAD1;
    /**
     * 无线通信网络信号强度 :0
     */
    private int signalStrength;
    /**
     * 无线通信网络信号强度 :0
     */
    private int satelliteNumber;
    /**
     * 数据是否有效 :false
     */
    private boolean isValid;
    /**
     * 关键点围栏附加信息
     */
    private List<KeyPointFenceAddition> defenceAddition = new ArrayList<KeyPointFenceAddition>();
    /**
     * 区域滞留超时附加信息
     */
    private List<OvertimeParkingAddition> parkingAddition = new ArrayList<OvertimeParkingAddition>();
    /**
     * 车辆状态附加信息
     */
    private VehicleStatusAddition statusAddition;
    /**
     * 车辆故障附加信息
     */
    private VehicleBreakdownAddition breakdownAddition;
    /**
     * 附加报警位
     */
    private AdditionAlarm additionAlarm;
    /**
     * 驾驶行为数据
     */
    private DrivingBehaviorAnalysis analysisData;
    /**
     * 电池电量百分比 %:0
     */
    private int batteryPower;
    /**
     * 模块电压 :[]
     */
    private List<ModuleVoltage> moduleVoltages = new ArrayList<ModuleVoltage>();
    /**
     * 电车状态
     */
    private long electricVehicle;
    /**
     * 报警撤销，位参看报警位定义（附录/枚举/报警），位值为1代表撤销；0代表正常报警
     */
    private long alarmFilter;
    /**
     * 上传时间
     */
    private String upload_time;
    /**
     * 车辆当前转速
     */
    private long rotation;

    /**
     * @param locationData LocationData
     * @param isEnd        Boolean
     * @return LocationData
     */
    public LocationData init(LCLocationData.LocationData locationData, Boolean isEnd) {
        setAlarm(locationData.getAlarm());
        setStatus(locationData.getStatus());
        setSpeed((short) locationData.getSpeed());
        setLongitude(locationData.getLongitude());
        setLatitude(locationData.getLatitude());
        setOriginalLng(locationData.getOriginalLng());
        setOriginalLat(locationData.getOriginalLat());
        setHeight(locationData.getHeight());
        setDirection((short) locationData.getDirection());
        setGpsDate(locationData.getGpsDate());
        setMileage(locationData.getMileage());
        setReceiveDate(locationData.getReceiveDate());
        setIsPatch(locationData.getIsPatch());
        setOil(locationData.getOil());
        setRecorderSpeed(locationData.getRecorderSpeed());
        setAlarmFilter(locationData.getAlarmFilter());
        List<LCLocationData.SpeedAddition> speedAdditionList = locationData.getSpeedAdditionList();
        if (speedAdditionList.size() > 0) {
            for (LCLocationData.SpeedAddition ss : speedAdditionList) {
                SpeedAddition s = new SpeedAddition();
                s.setTypes(ss.getTypes().name());
                s.setAreaId(ss.getAreaId());
                s.setLineId(ss.getLineId());
                speedAddition.add(s);
            }
        }
        List<LCLocationData.AreaAddition> areaAdditionList = locationData.getAreaAdditionList();
        if (areaAdditionList.size() > 0) {
            for (LCLocationData.AreaAddition ss : areaAdditionList) {
                AreaAddition s = new AreaAddition();
                s.setTypes(ss.getAreaType().name());
                s.setAreaId(ss.getAreaId());
                s.setDirection(ss.getDirection());
                areaAddition.add(s);
            }
        }
        List<LCLocationData.RouteAddition> routeAdditionList = locationData.getRouteAdditionList();
        if (routeAdditionList.size() > 0) {
            for (LCLocationData.RouteAddition ss : routeAdditionList) {
                RouteAddition s = new RouteAddition();
                s.setAreaId(ss.getAreaId());
                s.setLineId(ss.getLineId());
                s.setRouteResult(ss.getRouteResult());
                s.setRouteTime(ss.getRouteTime());
                routeAddition.add(s);
            }
        }
        List<LCLocationData.TemAddition> temAdditionList = locationData.getTemAlarmList();
        if (temAdditionList.size() > 0) {
            for (LCLocationData.TemAddition ss : temAdditionList) {
                TemAddition s = new TemAddition();
                s.setChannelId(ss.getChannelId());
                s.setTemAlarm(ss.getTemAlarm());
                s.setTemperature(ss.getTemperature());
                temAlarm.add(s);
            }
        }
        setStarStatus(locationData.getStarStatus());
        setStarNumber(locationData.getStarNumber());
        setAlarmIdentify(locationData.getAlarmIdentifyList());
        setSignalStatus(locationData.getSignalStatus());
        setIoStatus(locationData.getIoStatus());
        setAnalogAD0(locationData.getAnalogAD0());
        setAnalogAD1(locationData.getAnalogAD1());
        setSignalStrength(locationData.getSignalStrength());
        setSatelliteNumber(locationData.getSatelliteNumber());
        setIsValid(locationData.getIsValid());
        List<LCLocationData.KeyPointFenceAddition> keyPointFenceAdditionList = locationData.getDefenceAdditionList();
        if (keyPointFenceAdditionList.size() > 0) {
            for (LCLocationData.KeyPointFenceAddition ss : keyPointFenceAdditionList) {
                KeyPointFenceAddition s = new KeyPointFenceAddition();
                s.setAreaId(ss.getAreaId());
                s.setAreaType(ss.getAreaType().name());
                s.setFenceAlarm(ss.getFenceAlarm());
                defenceAddition.add(s);
            }
        }
        List<LCLocationData.OvertimeParkingAddition> overtimeParkingAdditionList =
                locationData.getParkingAdditionList();
        if (overtimeParkingAdditionList.size() > 0) {
            for (LCLocationData.OvertimeParkingAddition ss : overtimeParkingAdditionList) {
                OvertimeParkingAddition s = new OvertimeParkingAddition();
                s.setAreaId(ss.getAreaId());
                s.setAreaType(ss.getAreaType().name());
                parkingAddition.add(s);
            }
        }
        VehicleStatusAddition v = new VehicleStatusAddition();
        List<LCVehicleStatusData.VehicleStatusData> vvd = locationData.getStatusAddition().getStatusList();
        if (vvd.size() > 0) {
            for (LCVehicleStatusData.VehicleStatusData vv : vvd) {
                VehicleStatusData vd = new VehicleStatusData();
                vd.setTypes(vv.getTypes().getNumber());
                vd.setStatusValue(vv.getStatusValue());
                v.status.add(vd);
            }
        }
        setStatusAddition(v);
        VehicleBreakdownAddition vba = new VehicleBreakdownAddition();
        List<LCVehicleBreakdown.VehicleBreakdown> vsd = locationData.getBreakdownAddition().getBreakdownList();
        if (vsd.size() > 0) {
            for (LCVehicleBreakdown.VehicleBreakdown vv : vsd) {
                VehicleBreakdown vb = new VehicleBreakdown();
                // vb.setSpnChangeMode(vv.hasBreakdownSPNValue());
                vb.setBreakdownFMIValue(vv.getBreakdownFMIValue());
                vb.setBreakdownSPNValue(vv.getBreakdownSPNValue());
                // vb.setFaultsCount(vv.);
                vba.breakdown.add(vb);

            }
        }
        setBreakdownAddition(vba);
        AdditionAlarm aa = new AdditionAlarm();
        aa.setAdditionAlarm(locationData.getAdditionAlarm());
        setAdditionAlarm(aa);
        DrivingBehaviorAnalysis dba = new DrivingBehaviorAnalysis();
        LCDrivingBehaviorAnalysis.DrivingBehaviorAnalysis va = locationData.getAnalysisData();
        dba.setAbsTimes(va.getAbsTimes());
        dba.setBrakeTimes(va.getBrakeTimes());
        dba.setClutchTimes(va.getClutchTimes());
        dba.setCurrentGearshift(va.getCurrentGearshift());
        dba.setCurrentRPM(va.getCurrentRPM());
        dba.setDeviceIdentity(va.getDeviceIdentity());
        dba.setLowOilDrivingValue(va.getLowOilDrivingValue());
        dba.setRetarderTimes(va.getRetarderTimes());
        dba.setRpmWhenAlarming(va.getRpmWhenAlarming());
        dba.setTurningAngle(va.getTurningAngle());
        dba.setVehicleSpeedFromEcu(va.getVehicleSpeedFromEcu());
        dba.setVelocityChangeValue(va.getVelocityChangeValue());
        setAnalysisData(dba);
        setBatteryPower(locationData.getBatteryPower());
        List<LCLocationData.ModuleVoltage> mv = locationData.getModuleVoltagesList();
        if (mv.size() > 0) {
            for (LCLocationData.ModuleVoltage mm : mv) {
                ModuleVoltage mmv = new ModuleVoltage();
                mmv.setNumber(mm.getNumber());
                mmv.setVoltage(mm.getVoltage());
                moduleVoltages.add(mmv);
            }
        }
        setElectricVehicle(locationData.getElectricVehicle());
        setUpload_time(TimeUtil.getTime());
        return this;
    }

    /**
     * @return Long 终端id
     */
    public Long getTerminalId() {
        return this.terminalId;
    }

    /**
     * @param terminalId long
     */
    public void setTerminalId(Long terminalId) {
        this.terminalId = terminalId;
    }

    /**
     * @return long 报警标志
     */
    public long getAlarm() {
        return this.alarm;
    }

    /**
     * @param alarm long
     */
    public void setAlarm(long alarm) {
        this.alarm = alarm;
    }

    /**
     * @return long 状标志位
     */
    public long getStatus() {
        return this.status;
    }

    /**
     * @param status long
     */
    public void setStatus(long status) {
        this.status = status;
    }

    /**
     * @return int 经度
     */
    public int getLongitude() {
        return this.longitude;
    }

    /**
     * @param longitude int
     */
    public void setLongitude(int longitude) {
        this.longitude = longitude;
    }

    /**
     * @return int 纬度
     */
    public int getLatitude() {
        return this.latitude;
    }

    /**
     * @param latitude int
     */
    public void setLatitude(int latitude) {
        this.latitude = latitude;
    }

    /**
     * @return int 经度
     */
    public int getOriginalLng() {
        return this.originalLng;
    }

    /**
     * @param originalLng int
     */
    public void setOriginalLng(int originalLng) {
        this.originalLng = originalLng;
    }

    /**
     * @return int 维度
     */
    public int getOriginalLat() {
        return this.originalLat;
    }

    /**
     * @param originalLat int
     */
    public void setOriginalLat(int originalLat) {
        this.originalLat = originalLat;
    }

    /**
     * @return int 高程
     */
    public int getHeight() {
        return this.height;
    }

    /**
     * @param height int
     */
    public void setHeight(int height) {
        this.height = height;
    }

    /**
     * @return short 速度
     */
    public short getSpeed() {
        return this.speed;
    }

    /**
     * @param speed short
     */
    public void setSpeed(short speed) {
        this.speed = speed;
    }

    /**
     * @return short 方向
     */
    public short getDirection() {
        return this.direction;
    }

    /**
     * @param direction short
     */
    public void setDirection(short direction) {
        this.direction = direction;
    }

    /**
     * @return long GPS时间
     */
    public long getGpsDate() {
        return this.gpsDate;
    }

    /**
     * @param gpsDate long
     */
    public void setGpsDate(long gpsDate) {
        this.gpsDate = gpsDate;
    }

    /**
     * @return long 里程
     */
    public long getMileage() {
        return this.mileage;
    }

    /**
     * @param mileage long
     */
    public void setMileage(long mileage) {
        this.mileage = mileage;
    }

    /**
     * @return long 接收时间
     */
    public long getReceiveDate() {
        return this.receiveDate;
    }

    /**
     * @param receiveDate long
     */
    public void setReceiveDate(long receiveDate) {
        this.receiveDate = receiveDate;
    }

    /**
     * @return boolean 是否补偿数据
     */
    public boolean isIsPatch() {
        return this.isPatch;
    }

    /**
     * @param isPatch boolean
     */
    public void setIsPatch(boolean isPatch) {
        this.isPatch = isPatch;
    }

    /**
     * @return int 油量
     */
    public int getOil() {
        return this.oil;
    }

    /**
     * @param oil int
     */
    public void setOil(int oil) {
        this.oil = oil;
    }

    /**
     * @return int 行驶记录仪速度
     */
    public int getRecorderSpeed() {
        return this.recorderSpeed;
    }

    /**
     * @param recorderSpeed int
     */
    public void setRecorderSpeed(int recorderSpeed) {
        this.recorderSpeed = recorderSpeed;
    }

    /**
     * @return List<SpeedAddition> 超速报警附加信息
     */
    public List<SpeedAddition> getSpeedAddition() {
        return this.speedAddition;
    }

    /**
     * @param speedAddition List<SpeedAddition>
     */
    public void setSpeedAddition(List<SpeedAddition> speedAddition) {
        this.speedAddition = speedAddition;
    }

    /**
     * @return List<AreaAddition> 进入区域路线报警附加信息
     */
    public List<AreaAddition> getAreaAddition() {
        return this.areaAddition;
    }

    /**
     * @param areaAddition List<AreaAddition>
     */
    public void setAreaAddition(List<AreaAddition> areaAddition) {
        this.areaAddition = areaAddition;
    }

    /**
     * @return List<RouteAddition> 路段行驶时间不足
     */
    public List<RouteAddition> getRouteAddition() {
        return this.routeAddition;
    }

    /**
     * @param routeAddition List<RouteAddition>
     */
    public void setRouteAddition(List<RouteAddition> routeAddition) {
        this.routeAddition = routeAddition;
    }

    /**
     * @return List<TemAddition> 温度报警附加信息
     */
    public List<TemAddition> getTemAlarm() {
        return this.temAlarm;
    }

    /**
     * @param temAlarm List<TemAddition>
     */
    public void setTemAlarm(List<TemAddition> temAlarm) {
        this.temAlarm = temAlarm;
    }

    /**
     * @return int 星况
     */
    public int getStarStatus() {
        return this.starStatus;
    }

    /**
     * @param starStatus int
     */
    public void setStarStatus(int starStatus) {
        this.starStatus = starStatus;
    }

    /**
     * @return int 星数
     */
    public int getStarNumber() {
        return this.starNumber;
    }

    /**
     * @param starNumber int
     */
    public void setStarNumber(int starNumber) {
        this.starNumber = starNumber;
    }

    /**
     * 获取 需要人工确认的报警ID
     *
     * @return List<Integer> 需要人工确认的报警ID
     */
    public List<Integer> getAlarmIdentify() {
        return this.alarmIdentify;
    }

    /**
     * 设置 需要人工确认的报警ID
     *
     * @param alarmIdentify List<Integer>
     */
    public void setAlarmIdentify(List<Integer> alarmIdentify) {
        this.alarmIdentify = alarmIdentify;
    }

    /**
     * 获取 车辆信号状态，定义见下文 :0
     *
     * @return int 车辆信号状态
     */
    public int getSignalStatus() {
        return this.signalStatus;
    }

    /**
     * 设置 车辆信号状态，定义见下文 :0
     *
     * @param signalStatus int
     */
    public void setSignalStatus(int signalStatus) {
        this.signalStatus = signalStatus;
    }

    /**
     * 获取 IO状态位 :0
     *
     * @return int IO状态位
     */
    public int getIoStatus() {
        return this.ioStatus;
    }

    /**
     * 设置 IO状态位 :0
     *
     * @param ioStatus int
     */
    public void setIoStatus(int ioStatus) {
        this.ioStatus = ioStatus;
    }

    /**
     * 获取 AD0模拟量 :0
     *
     * @return int AD0模拟量
     */
    public int getAnalogAD0() {
        return this.analogAD0;
    }

    /**
     * 设置 AD0模拟量 :0
     *
     * @param analogAD0 int
     */
    public void setAnalogAD0(int analogAD0) {
        this.analogAD0 = analogAD0;
    }

    /**
     * 获取 AD1模拟量 :0
     *
     * @return int AD1模拟量
     */
    public int getAnalogAD1() {
        return this.analogAD1;
    }

    /**
     * 设置 AD1模拟量 :0
     *
     * @param analogAD1 int
     */
    public void setAnalogAD1(int analogAD1) {
        this.analogAD1 = analogAD1;
    }

    /**
     * 获取 无线通信网络信号强度 :0
     *
     * @return int 无线通信网络信号强度
     */
    public int getSignalStrength() {
        return this.signalStrength;
    }

    /**
     * 设置 无线通信网络信号强度 :0
     *
     * @param signalStrength int
     */
    public void setSignalStrength(int signalStrength) {
        this.signalStrength = signalStrength;
    }

    /**
     * 获取 无线通信网络信号强度 :0
     *
     * @return int 无线通信网络信号强度
     */
    public int getSatelliteNumber() {
        return this.satelliteNumber;
    }

    /**
     * 设置 无线通信网络信号强度 :0
     *
     * @param satelliteNumber int
     */
    public void setSatelliteNumber(int satelliteNumber) {
        this.satelliteNumber = satelliteNumber;
    }

    /**
     * 获取 数据是否有效 :false
     *
     * @return boolean 数据是否有效
     */
    public boolean isIsValid() {
        return this.isValid;
    }

    /**
     * 设置 数据是否有效 :false
     *
     * @param isValid boolean
     */
    public void setIsValid(boolean isValid) {
        this.isValid = isValid;
    }

    /**
     * 获取 关键点围栏附加信息
     *
     * @return List<KeyPointFenceAddition> 关键点围栏附加信息
     */
    public List<KeyPointFenceAddition> getDefenceAddition() {
        return this.defenceAddition;
    }

    /**
     * 设置 关键点围栏附加信息
     *
     * @param defenceAddition List<KeyPointFenceAddition>
     */
    public void setDefenceAddition(List<KeyPointFenceAddition> defenceAddition) {
        this.defenceAddition = defenceAddition;
    }

    /**
     * 获取 区域滞留超时附加信息
     *
     * @return List<OvertimeParkingAddition> 区域滞留超时附加信息
     */
    public List<OvertimeParkingAddition> getParkingAddition() {
        return this.parkingAddition;
    }

    /**
     * 设置 区域滞留超时附加信息
     *
     * @param parkingAddition List<OvertimeParkingAddition>
     */
    public void setParkingAddition(List<OvertimeParkingAddition> parkingAddition) {
        this.parkingAddition = parkingAddition;
    }

    /**
     * 获取 车辆状态附加信息
     *
     * @return VehicleStatusAddition 车辆状态附加信息
     */
    public VehicleStatusAddition getStatusAddition() {
        return this.statusAddition;
    }

    /**
     * 设置 车辆状态附加信息
     *
     * @param statusAddition VehicleStatusAddition
     */
    public void setStatusAddition(VehicleStatusAddition statusAddition) {
        this.statusAddition = statusAddition;
    }

    /**
     * 获取 车辆故障附加信息
     *
     * @return VehicleBreakdownAddition 车辆故障附加信息
     */
    public VehicleBreakdownAddition getBreakdownAddition() {
        return this.breakdownAddition;
    }

    /**
     * 设置 车辆故障附加信息
     *
     * @param breakdownAddition VehicleBreakdownAddition
     */
    public void setBreakdownAddition(VehicleBreakdownAddition breakdownAddition) {
        this.breakdownAddition = breakdownAddition;
    }

    /**
     * 获取 附加报警位
     *
     * @return AdditionAlarm 附加报警位
     */
    public AdditionAlarm getAdditionAlarm() {
        return this.additionAlarm;
    }

    /**
     * 设置 附加报警位
     *
     * @param additionAlarm AdditionAlarm
     */
    public void setAdditionAlarm(AdditionAlarm additionAlarm) {
        this.additionAlarm = additionAlarm;
    }

    /**
     * 获取 驾驶行为数据
     *
     * @return DrivingBehaviorAnalysis 驾驶行为数据
     */
    public DrivingBehaviorAnalysis getAnalysisData() {
        return this.analysisData;
    }

    /**
     * 设置 驾驶行为数据
     *
     * @param analysisData DrivingBehaviorAnalysis
     */
    public void setAnalysisData(DrivingBehaviorAnalysis analysisData) {
        this.analysisData = analysisData;
    }

    /**
     * 获取 电池电量百分比 %:0
     *
     * @return int 电池电量百分比
     */
    public int getBatteryPower() {
        return this.batteryPower;
    }

    /**
     * 设置 电池电量百分比 %:0
     *
     * @param batteryPower int
     */
    public void setBatteryPower(int batteryPower) {
        this.batteryPower = batteryPower;
    }

    /**
     * 获取 模块电压 :[]
     *
     * @return List<ModuleVoltage> 模块电压
     */
    public List<ModuleVoltage> getModuleVoltages() {
        return this.moduleVoltages;
    }

    /**
     * 设置 模块电压 :[]
     *
     * @param moduleVoltages List<ModuleVoltage>
     */
    public void setModuleVoltages(List<ModuleVoltage> moduleVoltages) {
        this.moduleVoltages = moduleVoltages;
    }

    /**
     * 获取 电车状态
     *
     * @return long 电车状态
     */
    public long getElectricVehicle() {
        return this.electricVehicle;
    }

    /**
     * 设置 电车状态
     *
     * @param electricVehicle long
     */
    public void setElectricVehicle(long electricVehicle) {
        this.electricVehicle = electricVehicle;
    }

    /**
     * 获取 报警撤销，位参看报警位定义（附录/枚举/报警），位值为1代表撤销；0代表正常报警
     *
     * @return long 报警撤销
     */
    public long getAlarmFilter() {
        return this.alarmFilter;
    }

    /**
     * 设置 报警撤销，位参看报警位定义（附录/枚举/报警），位值为1代表撤销；0代表正常报警
     *
     * @param alarmFilter long
     */
    public void setAlarmFilter(long alarmFilter) {
        this.alarmFilter = alarmFilter;
    }

    /**
     * 获取 上传时间
     *
     * @return String 上传时间
     */
    public String getUpload_time() {
        return this.upload_time;
    }

    /**
     * 设置 上传时间
     *
     * @param uploadTime String
     */
    public void setUpload_time(String uploadTime) {
        this.upload_time = uploadTime;
    }

    /**
     * 获取 车辆当前转速
     *
     * @return long 车辆当前转速
     */
    public long getRotation() {
        return this.rotation;
    }

    /**
     * 设置 车辆当前转速
     *
     * @param rotation long
     */
    public void setRotation(long rotation) {
        this.rotation = rotation;
    }

    /**
     * SpeedAddition
     */
    public static class SpeedAddition {

        /**
         * 区域类型 value
         */
        private String types;
        /**
         * 区域/路线ID
         */
        private long areaId;
        /**
         * 路段ID
         */
        private long lineId;

        /**
         * @return String
         */
        public String getTypes() {
            return types;
        }

        /**
         * @param types String
         */
        public void setTypes(String types) {
            this.types = types;
        }

        /**
         * @return long
         */
        public long getAreaId() {
            return areaId;
        }

        /**
         * @param areaId long
         */
        public void setAreaId(long areaId) {
            this.areaId = areaId;
        }

        /**
         * @return long
         */
        public long getLineId() {
            return lineId;
        }

        /**
         * @param lineId long
         */
        public void setLineId(long lineId) {
            this.lineId = lineId;
        }
    }

    /**
     * AreaAddition
     */
    public static class AreaAddition {
        /**
         * 区域类型 value
         */
        private String types;
        /**
         * 区域/路线ID
         */
        private long areaId;
        /**
         * true;false
         */
        private boolean direction;

        /**
         * @return String
         */
        public String getTypes() {
            return types;
        }

        /**
         * @param types 区域类型
         */
        public void setTypes(String types) {
            this.types = types;
        }

        /**
         * @return long
         */
        public long getAreaId() {
            return areaId;
        }

        /**
         * @param areaId 区域/路线ID
         */
        public void setAreaId(long areaId) {
            this.areaId = areaId;
        }

        /**
         * @return boolean
         */
        public boolean isDirection() {
            return direction;
        }

        /**
         * @param direction boolean
         */
        public void setDirection(boolean direction) {
            this.direction = direction;
        }
    }

    /**
     * RouteAddition
     */
    public static class RouteAddition {
        /**
         * 路线ID
         */
        private long areaId;
        /**
         * 路段ID
         */
        private long lineId;
        /**
         * 行驶时间（秒)
         */
        private int routeTime;
        /**
         * true：不足 false：过长
         */
        private boolean routeResult;


        /**
         * 获取 路线ID
         *
         * @return long 路线ID
         */
        public long getAreaId() {
            return this.areaId;
        }

        /**
         * 设置 路线ID
         *
         * @param areaId long
         */
        public void setAreaId(long areaId) {
            this.areaId = areaId;
        }

        /**
         * 获取 路段ID
         *
         * @return long 路段ID
         */
        public long getLineId() {
            return this.lineId;
        }

        /**
         * 设置 路段ID
         *
         * @param lineId long
         */
        public void setLineId(long lineId) {
            this.lineId = lineId;
        }

        /**
         * 获取 行驶时间（秒)
         *
         * @return int 行驶时间
         */
        public int getRouteTime() {
            return this.routeTime;
        }

        /**
         * 设置 行驶时间（秒)
         *
         * @param routeTime int
         */
        public void setRouteTime(int routeTime) {
            this.routeTime = routeTime;
        }

        /**
         * 获取 true：不足 false：过长
         *
         * @return boolean true：不足 false：过长
         */
        public boolean isRouteResult() {
            return this.routeResult;
        }

        /**
         * 设置 true：不足 false：过长
         *
         * @param routeResult boolean
         */
        public void setRouteResult(boolean routeResult) {
            this.routeResult = routeResult;
        }
    }

    /**
     * TemAddition
     */
    public static class TemAddition {
        /**
         * 通道ID
         */
        private int channelId;
        /**
         * true：报警 false：未报警
         */
        private boolean temAlarm;
        /**
         * 温度
         */
        private int temperature;


        /**
         * 获取 通道ID
         *
         * @return int 通道ID
         */
        public int getChannelId() {
            return this.channelId;
        }

        /**
         * 设置 通道ID
         *
         * @param channelId int
         */
        public void setChannelId(int channelId) {
            this.channelId = channelId;
        }

        /**
         * 获取 true：报警 false：未报警
         *
         * @return boolean true：报警 false：未报警
         */
        public boolean isTemAlarm() {
            return this.temAlarm;
        }

        /**
         * 设置 true：报警 false：未报警
         *
         * @param temAlarm boolean
         */
        public void setTemAlarm(boolean temAlarm) {
            this.temAlarm = temAlarm;
        }

        /**
         * 获取 温度
         *
         * @return int 温度
         */
        public int getTemperature() {
            return this.temperature;
        }

        /**
         * 设置 温度
         *
         * @param temperature int
         */
        public void setTemperature(int temperature) {
            this.temperature = temperature;
        }
    }

    /**
     * KeyPointFenceAddition
     */
    public static class KeyPointFenceAddition {
        /**
         * 区域类型
         */
        private String areaType;
        /**
         * 区域ID
         */
        private long areaId;
        /**
         * true：未按时抵达关键点；false：未按时离开关键点；
         */
        private boolean fenceAlarm;


        /**
         * 获取 区域类型
         *
         * @return String 区域类型
         */
        public String getAreaType() {
            return this.areaType;
        }

        /**
         * 设置 区域类型
         *
         * @param areaType String
         */
        public void setAreaType(String areaType) {
            this.areaType = areaType;
        }

        /**
         * 获取 区域ID
         *
         * @return long 区域ID
         */
        public long getAreaId() {
            return this.areaId;
        }

        /**
         * 设置 区域ID
         *
         * @param areaId long
         */
        public void setAreaId(long areaId) {
            this.areaId = areaId;
        }

        /**
         * 获取 true：未按时抵达关键点；false：未按时离开关键点；
         *
         * @return boolean true：未按时抵达关键点；false：未按时离开关键点；
         */
        public boolean isFenceAlarm() {
            return this.fenceAlarm;
        }

        /**
         * 设置 true：未按时抵达关键点；false：未按时离开关键点；
         *
         * @param fenceAlarm boolean
         */
        public void setFenceAlarm(boolean fenceAlarm) {
            this.fenceAlarm = fenceAlarm;
        }
    }

    /**
     * OvertimeParkingAddition
     */
    public static class OvertimeParkingAddition {
        /**
         * 区域类型
         */
        private String areaType;
        /**
         * 区域ID
         */
        private long areaId;


        /**
         * 获取 区域类型
         *
         * @return String 区域类型
         */
        public String getAreaType() {
            return this.areaType;
        }

        /**
         * 设置 区域类型
         *
         * @param areaType String
         */
        public void setAreaType(String areaType) {
            this.areaType = areaType;
        }

        /**
         * 获取 区域ID
         *
         * @return long 区域ID
         */
        public long getAreaId() {
            return this.areaId;
        }

        /**
         * 设置 区域ID
         *
         * @param areaId long
         */
        public void setAreaId(long areaId) {
            this.areaId = areaId;
        }
    }

    /**
     * VehicleStatusAddition
     */
    public static class VehicleStatusAddition {

        /**
         * 车辆状态
         */
        private List<VehicleStatusData> status = new ArrayList<VehicleStatusData>();

        /**
         * @return List<VehicleStatusData> 车辆状态
         */
        public List<VehicleStatusData> getStatus() {
            return status;
        }

        /**
         * @param status List<VehicleStatusData>
         */
        public void setStatus(List<VehicleStatusData> status) {
            this.status = status;
        }
    }

    /**
     * VehicleStatusData
     */
    public static class VehicleStatusData {

        /**
         * 状态类型
         */
        private int types;
        /**
         * 状态数值
         */
        private long statusValue;

        /**
         * @return int 状态类型
         */
        public int getTypes() {
            return types;
        }

        /**
         * @param types int
         */
        public void setTypes(int types) {
            this.types = types;
        }

        /**
         * @return long 状态数值
         */
        public long getStatusValue() {
            return statusValue;
        }

        /**
         * @param statusValue long
         */
        public void setStatusValue(long statusValue) {
            this.statusValue = statusValue;
        }
    }

    /**
     * DrivingBehaviorAnalysis
     */
    public static class DrivingBehaviorAnalysis {

        /**
         * 急转弯参数，发生急转弯时的当前角度值
         */
        private int turningAngle;
        /**
         * 发生低油量行驶报警时的油量值（单位：）
         */
        private int lowOilDrivingValue;
        /**
         * 获取到ECU传的车辆速度，该值为当前车辆速度（单位：）
         */
        private int vehicleSpeedFromEcu;
        /**
         * 发生报警时的发动机转速当前值（单位：）
         */
        private int rpmWhenAlarming;
        /**
         * 发生急加速、急减速的当前值（单位：）
         */
        private int velocityChangeValue;
        /**
         * 车辆当前档位
         */
        private int currentGearshift;
        /**
         * 车辆当前发送机转速（单位：）
         */
        private int currentRPM;
        /**
         * 当车辆ACC开启时，终端查询并存储的北斗终端ID号
         */
        private String deviceIdentity;
        /**
         * 刹车区间次数
         */
        private int brakeTimes;
        /**
         * 离合区间次数
         */
        private int clutchTimes;
        /**
         * 缓速器次数
         */
        private int retarderTimes;
        /**
         * ABS次数
         */
        private int absTimes;
        /**
         * 倒档次数
         */
        private int reverseTimes;

        /**
         * 获得急转弯参数，发生急转弯时的当前角度值
         *
         * @return turningAngle
         */
        public int getTurningAngle() {
            return turningAngle;
        }

        /**
         * 设置急转弯参数，发生急转弯时的当前角度值
         *
         * @param turningAngle turningAngle
         */
        public void setTurningAngle(int turningAngle) {
            this.turningAngle = turningAngle;
        }

        /**
         * 获得发生低油量行驶报警时的油量值
         *
         * @return lowOilDrivingValue
         */
        public int getLowOilDrivingValue() {
            return lowOilDrivingValue;
        }

        /**
         * 设置发生低油量行驶报警时的油量值
         *
         * @param lowOilDrivingValue 发生低油量行驶报警时的油量值
         */
        public void setLowOilDrivingValue(int lowOilDrivingValue) {
            this.lowOilDrivingValue = lowOilDrivingValue;
        }

        /**
         * 获得获取到ECU传的车辆速度，该值为当前车辆速度
         *
         * @return vehicleSpeedFromEcu
         */
        public int getVehicleSpeedFromEcu() {
            return vehicleSpeedFromEcu;
        }

        /**
         * 设置获取到ECU传的车辆速度，该值为当前车辆速度
         *
         * @param vehicleSpeedFromEcu 获取到ECU传的车辆速度，该值为当前车辆速度
         */
        public void setVehicleSpeedFromEcu(int vehicleSpeedFromEcu) {
            this.vehicleSpeedFromEcu = vehicleSpeedFromEcu;
        }

        /**
         * 获得发生报警时的发动机转速当前值
         *
         * @return rpmWhenAlarming
         */
        public int getRpmWhenAlarming() {
            return rpmWhenAlarming;
        }

        /**
         * 设置发生报警时的发动机转速当前值
         *
         * @param rpmWhenAlarming 发生报警时的发动机转速当前值
         */
        public void setRpmWhenAlarming(int rpmWhenAlarming) {
            this.rpmWhenAlarming = rpmWhenAlarming;
        }

        /**
         * 获得发生急加速、急减速的当前值
         *
         * @return velocityChangeValue
         */
        public int getVelocityChangeValue() {
            return velocityChangeValue;
        }

        /**
         * 设置发生急加速、急减速的当前值
         *
         * @param velocityChangeValue 发生急加速、急减速的当前值
         */
        public void setVelocityChangeValue(int velocityChangeValue) {
            this.velocityChangeValue = velocityChangeValue;
        }

        /**
         * 获得车辆当前档位
         *
         * @return currentGearshift
         */
        public int getCurrentGearshift() {
            return currentGearshift;
        }

        /**
         * 设置车辆当前档位
         *
         * @param currentGearshift 车辆当前档位
         */
        public void setCurrentGearshift(int currentGearshift) {
            this.currentGearshift = currentGearshift;
        }

        /**
         * 获得车辆当前发送机转速
         *
         * @return int 车辆当前发送机转速
         */
        public int getCurrentRPM() {
            return currentRPM;
        }

        /**
         * 设置车辆当前发送机转速
         *
         * @param currentRPM 车辆当前发送机转速
         */
        public void setCurrentRPM(int currentRPM) {
            this.currentRPM = currentRPM;
        }

        /**
         * 获得当车辆ACC开启时，终端查询并存储的北斗终端ID号
         *
         * @return String 当车辆ACC开启时，终端查询并存储的北斗终端ID号
         */
        public String getDeviceIdentity() {
            return deviceIdentity;
        }

        /**
         * 设置当车辆ACC开启时，终端查询并存储的北斗终端ID号
         *
         * @param deviceIdentity 当车辆ACC开启时，终端查询并存储的北斗终端ID号
         */
        public void setDeviceIdentity(String deviceIdentity) {
            this.deviceIdentity = deviceIdentity;
        }

        /**
         * @return int 刹车区间次数
         */
        public int getBrakeTimes() {
            return brakeTimes;
        }

        /**
         * @param brakeTimes int
         */
        public void setBrakeTimes(int brakeTimes) {
            this.brakeTimes = brakeTimes;
        }

        /**
         * @return int 离合区间次数
         */
        public int getClutchTimes() {
            return clutchTimes;
        }

        /**
         * @param clutchTimes int
         */
        public void setClutchTimes(int clutchTimes) {
            this.clutchTimes = clutchTimes;
        }

        /**
         * @return int 缓速器次数
         */
        public int getRetarderTimes() {
            return retarderTimes;
        }

        /**
         * @param retarderTimes int
         */
        public void setRetarderTimes(int retarderTimes) {
            this.retarderTimes = retarderTimes;
        }

        /**
         * @return int ABS次数
         */
        public int getAbsTimes() {
            return absTimes;
        }

        /**
         * @param absTimes int
         */
        public void setAbsTimes(int absTimes) {
            this.absTimes = absTimes;
        }

        /**
         * @return int 倒档次数
         */
        public int getReverseTimes() {
            return reverseTimes;
        }

        /**
         * @param reverseTimes int
         */
        public void setReverseTimes(int reverseTimes) {
            this.reverseTimes = reverseTimes;
        }
    }

    /**
     * VehicleBreakdownAddition
     */
    public static class VehicleBreakdownAddition {

        /**
         * 车辆故障
         */
        private List<VehicleBreakdown> breakdown = new ArrayList<VehicleBreakdown>();

        /**
         * 获得车辆故障
         *
         * @return breakdown
         */
        public List<VehicleBreakdown> getBreakdown() {
            return breakdown;
        }

        /**
         * 设置车辆故障
         *
         * @param breakdown 车辆故障
         */
        public void setBreakdown(List<VehicleBreakdown> breakdown) {
            this.breakdown = breakdown;
        }
    }

    /**
     * VehicleBreakdown
     */
    public static class VehicleBreakdown implements Serializable {
        /**
         * 故障SPN数值
         */
        private int breakdownSPNValue;
        /**
         * 故障FMI数值
         */
        private int breakdownFMIValue;
        /**
         * SPN转换模式
         */
        private int spnChangeMode;
        /**
         * 当前故障计数
         */
        private int faultsCount;

        /**
         * 获得故障SPN数值
         *
         * @return breakdownSPNValue
         */
        public int getBreakdownSPNValue() {
            return breakdownSPNValue;
        }

        /**
         * 设置故障SPN数值
         *
         * @param breakdownSPNValue 故障SPN数值
         */
        public void setBreakdownSPNValue(int breakdownSPNValue) {
            this.breakdownSPNValue = breakdownSPNValue;
        }

        /**
         * 获得故障FMI数值
         *
         * @return int 故障FMI数值
         */
        public int getBreakdownFMIValue() {
            return breakdownFMIValue;
        }

        /**
         * 设置故障FMI数值
         *
         * @param breakdownFMIValue 故障FMI数值
         */
        public void setBreakdownFMIValue(int breakdownFMIValue) {
            this.breakdownFMIValue = breakdownFMIValue;
        }

        /**
         * 获得SPN转换模式
         *
         * @return int SPN转换模式
         */
        public int getSpnChangeMode() {
            return spnChangeMode;
        }

        /**
         * 设置SPN转换模式
         *
         * @param spnChangeMode SPN转换模式
         */
        public void setSpnChangeMode(int spnChangeMode) {
            this.spnChangeMode = spnChangeMode;
        }

        /**
         * 获得当前故障计数
         *
         * @return int 当前故障计数
         */
        public int getFaultsCount() {
            return faultsCount;
        }

        /**
         * 设置当前故障计数
         *
         * @param faultsCount 当前故障计数
         */
        public void setFaultsCount(int faultsCount) {
            this.faultsCount = faultsCount;
        }
    }

    /**
     * ModuleVoltage
     */
    public static class ModuleVoltage {
        /**
         * 箱号
         */
        private int number;
        /**
         * 电压
         */
        private float voltage;

        /**
         * 返回箱号
         *
         * @return number
         */
        public int getNumber() {
            return number;
        }

        /**
         * 设置箱号
         *
         * @param number 箱号
         */
        public void setNumber(int number) {
            this.number = number;
        }

        /**
         * 返回电压
         *
         * @return float 电压
         */
        public float getVoltage() {
            return voltage;
        }

        /**
         * 设置电压
         *
         * @param voltage 电压
         */
        public void setVoltage(float voltage) {
            this.voltage = voltage;
        }
    }

    /**
     * AdditionAlarm
     */
    public static class AdditionAlarm {

        /**
         * additionAlarm02
         */
        private AdditionAlarm02 additionAlarm02 = new AdditionAlarm02();

        /**
         * additionAlarm06
         */
        private AdditionAlarm06 additionAlarm06 = new AdditionAlarm06();

        /**
         * additionAlarm07
         */
        private AdditionAlarm07 additionAlarm07 = new AdditionAlarm07();

        /**
         * additionAlarm08
         */
        private AdditionAlarm08 additionAlarm08 = new AdditionAlarm08();

        /**
         * @param alarms ByteString
         */
        public void setAdditionAlarm(ByteString alarms) {
            if (alarms != null && alarms.size() != 0) {
                additionAlarm02.set02(alarms.byteAt(1));
                additionAlarm06.set06(alarms.byteAt(5));
                additionAlarm07.set07(alarms.byteAt(6));
                additionAlarm08.set08(alarms.byteAt(7));
            }
        }


        /**
         * 获取 additionAlarm02
         *
         * @return AdditionAlarm02
         */
        public AdditionAlarm02 getAdditionAlarm02() {
            return this.additionAlarm02;
        }

        /**
         * 设置 additionAlarm02
         *
         * @param additionAlarm02 AdditionAlarm02
         */
        public void setAdditionAlarm02(AdditionAlarm02 additionAlarm02) {
            this.additionAlarm02 = additionAlarm02;
        }

        /**
         * 获取 additionAlarm06
         *
         * @return AdditionAlarm06
         */
        public AdditionAlarm06 getAdditionAlarm06() {
            return this.additionAlarm06;
        }

        /**
         * 设置 additionAlarm06
         *
         * @param additionAlarm06 AdditionAlarm06
         */
        public void setAdditionAlarm06(AdditionAlarm06 additionAlarm06) {
            this.additionAlarm06 = additionAlarm06;
        }

        /**
         * 获取 additionAlarm07
         *
         * @return AdditionAlarm07
         */
        public AdditionAlarm07 getAdditionAlarm07() {
            return this.additionAlarm07;
        }

        /**
         * 设置 additionAlarm07
         *
         * @param additionAlarm07 AdditionAlarm07
         */
        public void setAdditionAlarm07(AdditionAlarm07 additionAlarm07) {
            this.additionAlarm07 = additionAlarm07;
        }

        /**
         * 获取 additionAlarm08
         *
         * @return AdditionAlarm08
         */
        public AdditionAlarm08 getAdditionAlarm08() {
            return this.additionAlarm08;
        }

        /**
         * 设置 additionAlarm08
         *
         * @param additionAlarm08 AdditionAlarm08
         */
        public void setAdditionAlarm08(AdditionAlarm08 additionAlarm08) {
            this.additionAlarm08 = additionAlarm08;
        }
    }

    /**
     * AdditionAlarm06
     */
    public static class AdditionAlarm06 {

        /**
         * 0x01 BIT0 空挡滑行1:空挡滑行 0:正常
         */
        private int slideNeutral;
        /**
         * 0x02 BIT1 急加速，1:急加 0:正常
         */
        private int rapidAcceleration;
        /**
         * 0x04 BIT2 急减速，1:急减 0:正常
         */
        private int rapidDeceleration;
        /**
         * 0x08 BIT3 急转弯状,1:急转 0:正常
         */
        private int sharpTurning;
        /**
         * 0x10 BIT4 低油量报警状态，1:低油量行 0:正常
         */
        private int lowOilState;
        /**
         * 0x20 BIT5 保留0
         */
        private int undetermined;
        /**
         * 0x40 BIT6 猛踩油门报警状，1:猛踩油门 0:正常
         */
        private int slamTheAccelerator;
        /**
         * 0x80 BIT7 制动气压低报警状态，1:制动气压 0:正常
         */
        private int brakePressureLow;

        /**
         * @param alarm6 byte
         */
        public void set06(byte alarm6) {

            setSlideNeutral((alarm6 & 1) > 0 ? 1 : 0);
            setRapidAcceleration((alarm6 & Math.round(Math.pow(2, 1))) > 0 ? 1 : 0);
            setRapidDeceleration((alarm6 & Math.round(Math.pow(2, 2))) > 0 ? 1 : 0);
            setSharpTurning((alarm6 & Math.round(Math.pow(2, 3))) > 0 ? 1 : 0);
            setLowOilState((alarm6 & Math.round(Math.pow(2, 4))) > 0 ? 1 : 0);
            setUndetermined(0);
            setSlamTheAccelerator((alarm6 & Math.round(Math.pow(2, 6))) > 0 ? 1 : 0);
            setBrakePressureLow((alarm6 & Math.round(Math.pow(2, 7))) > 0 ? 1 : 0);

        }


        /**
         * 获取 0x01 BIT0 空挡滑行1:空挡滑行 0:正常
         *
         * @return int 空挡滑行1
         */
        public int getSlideNeutral() {
            return this.slideNeutral;
        }

        /**
         * 设置 0x01 BIT0 空挡滑行1:空挡滑行 0:正常
         *
         * @param slideNeutral 空挡滑行1
         */
        public void setSlideNeutral(int slideNeutral) {
            this.slideNeutral = slideNeutral;
        }

        /**
         * 获取 0x02 BIT1 急加速，1:急加 0:正常
         *
         * @return int BIT1
         */
        public int getRapidAcceleration() {
            return this.rapidAcceleration;
        }

        /**
         * 设置 0x02 BIT1 急加速，1:急加 0:正常
         *
         * @param rapidAcceleration 急加速
         */
        public void setRapidAcceleration(int rapidAcceleration) {
            this.rapidAcceleration = rapidAcceleration;
        }

        /**
         * 获取 0x04 BIT2 急减速，1:急减 0:正常
         *
         * @return int BIT2
         */
        public int getRapidDeceleration() {
            return this.rapidDeceleration;
        }

        /**
         * 设置 0x04 BIT2 急减速，1:急减 0:正常
         *
         * @param rapidDeceleration 急减速
         */
        public void setRapidDeceleration(int rapidDeceleration) {
            this.rapidDeceleration = rapidDeceleration;
        }

        /**
         * 获取 0x08 BIT3 急转弯状,1:急转 0:正常
         *
         * @return int 急转弯状
         */
        public int getSharpTurning() {
            return this.sharpTurning;
        }

        /**
         * 设置 0x08 BIT3 急转弯状,1:急转 0:正常
         *
         * @param sharpTurning 急转弯状
         */
        public void setSharpTurning(int sharpTurning) {
            this.sharpTurning = sharpTurning;
        }

        /**
         * 获取 0x10 BIT4 低油量报警状态，1:低油量行 0:正常
         *
         * @return int 低油量报警状态
         */
        public int getLowOilState() {
            return this.lowOilState;
        }

        /**
         * 设置 0x10 BIT4 低油量报警状态，1:低油量行 0:正常
         *
         * @param lowOilState 低油量报警状态
         */
        public void setLowOilState(int lowOilState) {
            this.lowOilState = lowOilState;
        }

        /**
         * 获取 0x20 BIT5 保留0
         *
         * @return int BIT5
         */
        public int getUndetermined() {
            return this.undetermined;
        }

        /**
         * 设置 0x20 BIT5 保留0
         *
         * @param undetermined BIT5
         */
        public void setUndetermined(int undetermined) {
            this.undetermined = undetermined;
        }

        /**
         * 获取 0x40 BIT6 猛踩油门报警状，1:猛踩油门 0:正常
         *
         * @return int BIT6
         */
        public int getSlamTheAccelerator() {
            return this.slamTheAccelerator;
        }

        /**
         * 设置 0x40 BIT6 猛踩油门报警状，1:猛踩油门 0:正常
         *
         * @param slamTheAccelerator BIT6
         */
        public void setSlamTheAccelerator(int slamTheAccelerator) {
            this.slamTheAccelerator = slamTheAccelerator;
        }

        /**
         * 获取 0x80 BIT7 制动气压低报警状态，1:制动气压 0:正常
         *
         * @return int 制动气压低报警状态
         */
        public int getBrakePressureLow() {
            return this.brakePressureLow;
        }

        /**
         * 设置 0x80 BIT7 制动气压低报警状态，1:制动气压 0:正常
         *
         * @param brakePressureLow 制动气压低报警状态
         */
        public void setBrakePressureLow(int brakePressureLow) {
            this.brakePressureLow = brakePressureLow;
        }
    }

    /**
     * AdditionAlarm02
     */
    public static class AdditionAlarm02 {

        /**
         * 0x40 BIT6 1：防拆报
         */
        private int removeAlarm;

        /**
         * @param alarm2 byte
         */
        public void set02(byte alarm2) {
            setRemoveAlarm((alarm2 & Math.round(Math.pow(2, 6))) > 0 ? 1 : 0);
        }

        /**
         * @return removeAlarm 防拆报
         */
        public int getRemoveAlarm() {
            return removeAlarm;
        }

        /**
         * @param removeAlarm 防拆报
         */
        public void setRemoveAlarm(int removeAlarm) {
            this.removeAlarm = removeAlarm;
        }

    }

    /**
     * AdditionAlarm07
     */
    public static class AdditionAlarm07 {
        /**
         * 0x01 BIT0 长时间刹车报警状态，1:长时间刹 0:正常
         */
        private int longTimeBreaking;
        /**
         * 0x02 BIT1 长时间离合报警状1:长时间离 0:正常
         */
        private int longTimeClutch;
        /**
         * 0x04 BIT2 停车立即熄火状 1:停车立即熄火 0:正常
         */
        private int fastlyFlameout;
        /**
         * 0x08 BIT3 发动机冷启动报警状 1:发动机冷启动 0:正常
         */
        private int engineColdStart;
        /**
         * 0x10 BIT4 绿区外驾驶报 1:绿区外驾 0:正常
         */
        private int badDrivingHabits;
        /**
         * 0x40 BIT6 ID不匹配报 1:ID不匹 0:正常(当获取不到终端ID时填0)
         */
        private int idNotMatch;
        /**
         * 0x80 BIT7 北斗终端拆除报警（防拆线1:北斗终端拆出 0:正常
         */
        private int terminalRemove;

        /**
         * @param alarm7 byte
         */
        public void set07(byte alarm7) {

            setLongTimeBreaking((alarm7 & 1) > 0 ? 1 : 0);
            setLongTimeClutch((alarm7 & Math.round(Math.pow(2, 1))) > 0 ? 1 : 0);
            setFastlyFlameout((alarm7 & Math.round(Math.pow(2, 2))) > 0 ? 1 : 0);
            setEngineColdStart((alarm7 & Math.round(Math.pow(2, 3))) > 0 ? 1 : 0);
            setBadDrivingHabits((alarm7 & Math.round(Math.pow(2, 4))) > 0 ? 1 : 0);
            setIdNotMatch((alarm7 & Math.round(Math.pow(2, 6))) > 0 ? 1 : 0);
            setTerminalRemove((alarm7 & Math.round(Math.pow(2, 7))) > 0 ? 1 : 0);
        }


        /**
         * 获取 0x01 BIT0 长时间刹车报警状态，1:长时间刹 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getLongTimeBreaking() {
            return this.longTimeBreaking;
        }

        /**
         * 设置 0x01 BIT0 长时间刹车报警状态，1:长时间刹 0:正常
         *
         * @param longTimeBreaking int
         */
        public void setLongTimeBreaking(int longTimeBreaking) {
            this.longTimeBreaking = longTimeBreaking;
        }

        /**
         * 获取 0x02 BIT1 长时间离合报警状1:长时间离 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getLongTimeClutch() {
            return this.longTimeClutch;
        }

        /**
         * 设置 0x02 BIT1 长时间离合报警状1:长时间离 0:正常
         *
         * @param longTimeClutch int
         */
        public void setLongTimeClutch(int longTimeClutch) {
            this.longTimeClutch = longTimeClutch;
        }

        /**
         * 获取 0x04 BIT2 停车立即熄火状 1:停车立即熄火 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getFastlyFlameout() {
            return this.fastlyFlameout;
        }

        /**
         * 设置 0x04 BIT2 停车立即熄火状 1:停车立即熄火 0:正常
         *
         * @param fastlyFlameout int
         */
        public void setFastlyFlameout(int fastlyFlameout) {
            this.fastlyFlameout = fastlyFlameout;
        }

        /**
         * 获取 0x08 BIT3 发动机冷启动报警状 1:发动机冷启动 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getEngineColdStart() {
            return this.engineColdStart;
        }

        /**
         * 设置 0x08 BIT3 发动机冷启动报警状 1:发动机冷启动 0:正常
         *
         * @param engineColdStart int
         */
        public void setEngineColdStart(int engineColdStart) {
            this.engineColdStart = engineColdStart;
        }

        /**
         * 获取 0x10 BIT4 绿区外驾驶报 1:绿区外驾 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getBadDrivingHabits() {
            return this.badDrivingHabits;
        }

        /**
         * 设置 0x10 BIT4 绿区外驾驶报 1:绿区外驾 0:正常
         *
         * @param badDrivingHabits int
         */
        public void setBadDrivingHabits(int badDrivingHabits) {
            this.badDrivingHabits = badDrivingHabits;
        }

        /**
         * 获取 0x40 BIT6 ID不匹配报 1:ID不匹 0:正常(当获取不到终端ID时填0)
         *
         * @return int 长时间刹车报警状态
         */
        public int getIdNotMatch() {
            return this.idNotMatch;
        }

        /**
         * 设置 0x40 BIT6 ID不匹配报 1:ID不匹 0:正常(当获取不到终端ID时填0)
         *
         * @param idNotMatch int
         */
        public void setIdNotMatch(int idNotMatch) {
            this.idNotMatch = idNotMatch;
        }

        /**
         * 获取 0x80 BIT7 北斗终端拆除报警（防拆线1:北斗终端拆出 0:正常
         *
         * @return int 长时间刹车报警状态
         */
        public int getTerminalRemove() {
            return this.terminalRemove;
        }

        /**
         * 设置 0x80 BIT7 北斗终端拆除报警（防拆线1:北斗终端拆出 0:正常
         *
         * @param terminalRemove int
         */
        public void setTerminalRemove(int terminalRemove) {
            this.terminalRemove = terminalRemove;
        }
    }

    /**
     * AdditionAlarm08
     */
    public static class AdditionAlarm08 {
        /**
         * 0x01 BIT0 0：空调关1：空调开
         */
        private int airCondition;
        /**
         * 0x02 BIT1 0：手刹关1：手刹开
         */
        private int handBrake;
        /**
         * 0x04 BIT2 GPS活状 0:关闭 1:
         */
        private int gpsActivation;
        /**
         * 0x08 BIT3 握手状 0:成功 1:失败
         */
        private int handshake;
        /**
         * 0x10 BIT4 锁车状 0:未锁�? 1:锁车
         */
        private int lockVehicle;
        /**
         * 0x20 BIT5 KEY匹配状 0:不正�? 1:正确
         */
        private int keyMatch;
        /**
         * 0x40 BIT6 GPS ID匹配状 0:不匹配 1:匹配
         */
        private int gpsIdMatch;
        /**
         * 0x80 BIT7 ECU预判状 0:不锁 1:判断锁车
         */
        private int ecuAnticipation;

        /**
         * @param alarm8 byte
         */
        public void set08(byte alarm8) {

            setAirCondition((alarm8 & 1) > 0 ? 1 : 0);
            setHandBrake((alarm8 & Math.round(Math.pow(2, 1))) > 0 ? 1 : 0);
            setGpsActivation((alarm8 & Math.round(Math.pow(2, 2))) > 0 ? 1 : 0);
            setHandshake((alarm8 & Math.round(Math.pow(2, 3))) > 0 ? 1 : 0);
            setLockVehicle((alarm8 & Math.round(Math.pow(2, 4))) > 0 ? 1 : 0);
            setKeyMatch((alarm8 & Math.round(Math.pow(2, 5))) > 0 ? 1 : 0);
            setGpsIdMatch((alarm8 & Math.round(Math.pow(2, 6))) > 0 ? 1 : 0);
            setEcuAnticipation((alarm8 & Math.round(Math.pow(2, 7))) > 0 ? 1 : 0);

        }


        /**
         * 获取 0x01 BIT0 0：空调关1：空调开
         *
         * @return int BIT0
         */
        public int getAirCondition() {
            return this.airCondition;
        }

        /**
         * 设置 0x01 BIT0 0：空调关1：空调开
         *
         * @param airCondition int
         */
        public void setAirCondition(int airCondition) {
            this.airCondition = airCondition;
        }

        /**
         * 获取 0x02 BIT1 0：手刹关1：手刹开
         *
         * @return int BIT1
         */
        public int getHandBrake() {
            return this.handBrake;
        }

        /**
         * 设置 0x02 BIT1 0：手刹关1：手刹开
         *
         * @param handBrake int
         */
        public void setHandBrake(int handBrake) {
            this.handBrake = handBrake;
        }

        /**
         * 获取 0x04 BIT2 GPS活状 0:关闭 1:
         *
         * @return int BIT2
         */
        public int getGpsActivation() {
            return this.gpsActivation;
        }

        /**
         * 设置 0x04 BIT2 GPS活状 0:关闭 1:
         *
         * @param gpsActivation int
         */
        public void setGpsActivation(int gpsActivation) {
            this.gpsActivation = gpsActivation;
        }

        /**
         * 获取 0x08 BIT3 握手状 0:成功 1:失败
         *
         * @return int BIT3
         */
        public int getHandshake() {
            return this.handshake;
        }

        /**
         * 设置 0x08 BIT3 握手状 0:成功 1:失败
         *
         * @param handshake int
         */
        public void setHandshake(int handshake) {
            this.handshake = handshake;
        }

        /**
         * 获取 0x10 BIT4 锁车状 0:未锁车 1:锁车
         *
         * @return int BIT4
         */
        public int getLockVehicle() {
            return this.lockVehicle;
        }

        /**
         * 设置 0x10 BIT4 锁车状 0:未锁车 1:锁车
         *
         * @param lockVehicle int
         */
        public void setLockVehicle(int lockVehicle) {
            this.lockVehicle = lockVehicle;
        }

        /**
         * 获取 0x20 BIT5 KEY匹配状 0:不正确 1:正确
         *
         * @return int BIT5
         */
        public int getKeyMatch() {
            return this.keyMatch;
        }

        /**
         * 设置 0x20 BIT5 KEY匹配状 0:不正确 1:正确
         *
         * @param keyMatch int
         */
        public void setKeyMatch(int keyMatch) {
            this.keyMatch = keyMatch;
        }

        /**
         * 获取 0x40 BIT6 GPS ID匹配状 0:不匹配 1:匹配
         *
         * @return int BIT6
         */
        public int getGpsIdMatch() {
            return this.gpsIdMatch;
        }

        /**
         * 设置 0x40 BIT6 GPS ID匹配状 0:不匹配 1:匹配
         *
         * @param gpsIdMatch int
         */
        public void setGpsIdMatch(int gpsIdMatch) {
            this.gpsIdMatch = gpsIdMatch;
        }

        /**
         * 获取 0x80 BIT7 ECU预判状 0:不锁 1:判断锁车
         *
         * @return int BIT7
         */
        public int getEcuAnticipation() {
            return this.ecuAnticipation;
        }

        /**
         * 设置 0x80 BIT7 ECU预判状 0:不锁 1:判断锁车
         *
         * @param ecuAnticipation int
         */
        public void setEcuAnticipation(int ecuAnticipation) {
            this.ecuAnticipation = ecuAnticipation;
        }
    }

}
